package com.wwb.w0428;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
Button button;
EditText number;
EditText name;
EditText sex;
EditText hobby;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    button=findViewById(R.id.button);
    number=findViewById(R.id.number);
    name=findViewById(R.id.name);
    sex=findViewById(R.id.sex);
    hobby=findViewById(R.id.hobby);

    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            //跳转
            String number1=number.getText().toString();
            String name1=name.getText().toString();
            String sex1=sex.getText().toString();
            String hobby1=hobby.getText().toString();


            Intent intent=new Intent();
            intent.setAction("wwb");
            intent.addCategory("android.intent.category.DEFAULT" );

            intent.putExtra("number",number1);
            intent.putExtra("name",name1);
            intent.putExtra("sex",sex1);
            intent.putExtra("hobby",hobby1);
            startActivity(intent);
        }
    });

    }


}